package com.hongfan.oauth.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hongfan.common.mp.TableIdDeserializer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * @author yjr
 * @since 2022-10-09
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("oauth_client_details")
public class OauthClientDetailsEntity {

    @JSONField(name = "client_id", deserializeUsing = TableIdDeserializer.class)
    @TableId(value = "client_id", type = IdType.AUTO)
    private String clientId;

    @TableField(value = "authorities")
    private String authorities;

    @TableField(value = "additional_information")
    private String additionalInformation;

    @TableField(value = "scope")
    private String scope;

    @TableField(value = "refresh_token_validity")
    private Integer refreshTokenValidity = 0;

    @TableField(value = "client_secret")
    private String clientSecret;

    @TableField(value = "web_server_redirect_uri")
    private String webServerRedirectUri;

    @TableField(value = "autoapprove")
    private String autoapprove;

    @TableField(value = "authorized_grant_types")
    private String authorizedGrantTypes;

    /**
     * access_token的有效时间，单位：秒
     */
    @TableField(value = "access_token_validity")
    private Integer accessTokenValidity = 0;

    @TableField(value = "resource_ids")
    private String resourceIds;

}
